package com.teamone.etl.enterprise.controller;

import com.baomidou.mybatisplus.extension.api.ApiController;
import com.teamone.etl.enterprise.entity.Enterprise;
import com.teamone.etl.enterprise.service.EnterpriseService;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 @author WangZhuoRan */
@RestController
@RequestMapping("/enterprise")
public class EnterpriseFeignController extends ApiController {
    /**
     服务对象
     */
    @Resource
    private EnterpriseService enterpriseService;

    @GetMapping("/getByEnterpriseName")
    public Enterprise getByEnterpriseName(@RequestParam("enterpriseName") String enterpriseName){
        return enterpriseService.getByEnterpriseName(enterpriseName);
    }

    @GetMapping("/getAll")
    public List<Enterprise> getAll (){
        return enterpriseService.getAll();
    }

    @GetMapping("/getById")
    public Enterprise getById(@RequestParam("id") Integer id){
        return enterpriseService.getById(id);
    }

}
